package com.woniu51.finance.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 */
public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102200737304";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCxaqHBSC6z9vzfCT2GiHvszcg1cW69pAIBiRBahRyn5QM1v6VUFY8sctUURuHXOD7eECZ3bXezV32bHzITU+ZnArx1LhQA8Wv/z/B4ouU2VfaRoEoortuMQXpTIrKdWHnGfMRd/0PtszIkhf1tHjOWN+wsjQRj32qAtBZUAsNjT6hbTOAW0220alff7481eeyjTCMv95FebOtKPXO6jo/stpikQGwG5nXr80V1edbjVZ7WF6Iwbbhi31a6hFJ9nYaZeFBg1QNtJM3K0vVzcLeIXJQiunzbhWf7sXYZ+ih7T/FrQd8WEY+oG8DRfMiOdaW1nVsHDVaH3ryjHnCiRQizAgMBAAECggEBAI7u6HhuLeohHyKVMDM1vBlQxG6B/4TbIB6ajUlQGoENGOPxjUHLyLg3n4Ehhgs9LjD7c/IdiCU9ZF1X6aD2pBXzd180izsjRS4oGYUnP2DiKq6yI2zZStmZWvKlbp8jS6BknlNYNyLGjqwsIrsJbOgmD6jox1OrCAO+koqGW2Gizuw4AqLlWRsE1TjWrUaQLxub2oTFYL77wPJvE7VjpWLvn8frQnElICiNroY3iENq1XBn0f8o8srXgadJIvRXvCgAIuXjZama+Uvvt5eZ/H24Fg8KKbVJeQVZ3MOlqpaEPmKtg11FFgz0ltPoLuKemjaZCk9y5WbN/RYcKb2R/2ECgYEA7i5LepJPZV3BUBJxXERxKNqbO3289acO0ZiIC/E8fRhN8WKbRGFMU59GHq+yRb22pWR4tOd5CWj9Hze5bNdP/8posrQKOmTpvBKW6VdfpNDhof4FX75+P0U8+KvDS1WbmsI/OzfkmdhmRW0tCQolBCjIIJMKdmbG8gt8a3Ar7lECgYEAvrCP7Q9fzJU3h2s49fR5eLblnkB1JIMkIZE+D9X4BGXE4mRSa/7McPvYte/eqcwgIGpgMuubPfYuyH08s6JcyZlo+wPJ6O0TXB8bU5hzA4++Taodb9on0A1wZu0B4d+un11voE9gxUHsecFmN6kjNdy9t9DK532o+kmLnGPhMcMCgYBSidqAPGmlMAtIq0t7dQBd7vuybw1nd6AMBDbJJK0YkK6aAtjZpnoj1GMhSTOXNXow8JNf5YMtPqPRCKeKT0ca1lLX8spEmCnjkfGYJT4wyG4YjAXiuwnW9TB+4E8KMT1+MOhmpiTjJ3mxf3cG1ewj99n6Z9pNU6qHwHE6biHbMQKBgHLHpFp1HpzuVHZWu/qQJW3b6WrQMbLAnUb3PfwaNyeuekwrRtFqlXSMo20f7U8XZ18bqLv9xXwOayqS967I1EEk7mPpa+egjD6vGqu+37wNEed9tipVjhFVhYrurmtfUKTsgPxly0Hw5H6FQxnN3TvWmvvB2eBtawD8s+R22l4xAoGBAK1MpmPRLNYu6mOWuOi5jGUcFNVg8uPMHJoT+HolXjdVwkyJuU/lLHYiKmUZg/bLwAVFfVNlfJfUrVbxDSkWAp02waZ8uMX+M+xgpreKhmxO13s2YrB0aFCj7jgomiymJd/6mz6S1h5CfLxGf69JVcl/J28fLNITklOwNpxi+2c9";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxdexKja9GHiEpX+JR0XVIv0FhC6/daM999wv90DN+d9J3baFFrGY+rgZj6kGkn65fEe7nz8ygPV3qQdw9zfNEMeMES4Uh1UT6Yr/4blYR2YEaCJN50cF2KwefHO0ilhJhIsQ3E7xSyQaRbXzxaxwcWcb3+8AfrK3GB1UvO7isg0uZUDFJF5JtCsadFXnEQuVg7iOJo2biQXk4l6NsU9NAjljxDCWZAxccyfDPJ2Hq9Hfe6UrXcJHwwcf/K5g5y5IdoEmrCanazegQ9njuE4WRLMTr7BBdOb5e/0J9fLcHffVTRtKiIltNo0E46tbFyl6CHWBY0aA/NTNHa/j2WDpzQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://192.168.0.9:8888/Alipay/alipay/return";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝日志
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

